<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>搜索</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/template.css" media="all">
</head>
<style>
    html,body{
        width: 100%;
        height: 100%;
        background-color: silver;
    }
    .middle{
        width: 300px;
        height: 200px;
        position: absolute;
        background-color: #007AFF;
        top: 50%;
        left: 50%;
        margin-left: -150px;
        margin-top: -100px;
    }
    .input{
        margin: 30px;
    }
</style>
<body>
<div class="out">
    <div class="middle">
        <form action="/qunChat" method="post">
            <div class="input" style="margin-top: 50px;">
                <input type="text" id="number"  name="id" required lay-verify="required" placeholder="请输入房间号" autocomplete="off" class="layui-input">
            </div>
            <div class="input">
                <button type="submit" class="layui-btn layui-btn-disabled layui-btn-fluid">确认</button>
            </div>
        </form>
    </div>
</div>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#number").keydown(function (e) {
            if($('#number').val().length>3){
                return false;
            }
            if($('#number').val().length>2){
                $('.layui-btn').removeClass('layui-btn-disabled');
            }
            if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
                (e.keyCode >= 35 && e.keyCode <= 40)) {
                return;
            }
            if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                e.preventDefault();
            }
        });
    });
</script>
</body>
</html>
